Petra’s code with file locations changed to load in datasets and reading original .txt files instead of converted .RDS files.
# Read in raw data and save as RDS
#dd0 <- read_delim("I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HDeviceCGM.txt", delim = "|")
#export(dd0, "I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HDeviceCGM.rds")
dd0 <- read_delim("../data/HDeviceCGM.txt", delim = "|") %>%
janitor::clean_names() %>%
mutate_if(is.character,as.factor) %>%
mutate(pt_id=as.factor(pt_id)) %>%
filter(!record_type %in% c("Calibration"))
Parsed with column specification:
cols(
RecID = col_double(),
ParentHDeviceUploadsID = col_double(),
PtID = col_double(),
SiteID = col_double(),
DeviceDtTmDaysFromEnroll = col_double(),
DeviceTm = col_time(format = ""),
DexInternalDtTmDaysFromEnroll = col_double(),
DexInternalTm = col_time(format = ""),
RecordType = col_character(),
GlucoseValue = col_double()
)
# Metadata
#dd1 <- read_delim("I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HScreening.txt", delim = "|")
#export(dd1, "I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HScreening.rds")
dd1 <- read_delim("../data/HScreening.txt", delim = "|") %>%
janitor::clean_names() %>%
mutate_if(is.character,as.factor) %>%
mutate(pt_id=as.factor(pt_id)) %>%
select(c(pt_id, site_id, gender, ethnicity, diag_age, oth_gluc_lower_med, edu_level,
weight, height, cgm_use_status))
Parsed with column specification:
cols(
.default = col_double(),
Gender = col_character(),
Ethnicity = col_character(),
Race = col_character(),
SHMostRec = col_character(),
DKAMostRec = col_character(),
OthGlucLowerMed = col_character(),
EduLevel = col_character(),
AnnualInc = col_character(),
InsSCHIP = col_logical(),
InsIndian = col_logical(),
InsOtherGov = col_logical(),
InsUnknown = col_logical(),
PEAbnormal = col_character(),
CGMUseStatus = col_character(),
CGMUseDuration = col_character(),
CGMUseDevice = col_character(),
CGMDLoadMinDays = col_character(),
CGMGlucUnder60 = col_character()
)
See spec(...) for full column specifications.
#dd2 <- read_delim("I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HPtRoster.txt", delim = "|")
#export(dd2, "I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HPtRoster.rds")
dd2 <- read_delim("../data/HPtRoster.txt", delim = "|") %>%
janitor::clean_names() %>%
mutate_if(is.character,as.factor) %>%
mutate(pt_id=as.factor(pt_id)) %>%
select(pt_id, pt_status, trt_group, age_as_of_enroll_dt)
Parsed with column specification:
cols(
RecID = col_double(),
PtID = col_double(),
SiteOrig = col_double(),
SiteID = col_double(),
RandDtDaysAfterEnroll = col_double(),
PtStatus = col_character(),
TrtGroup = col_character(),
AgeAsOfEnrollDt = col_double()
)
ds_subject <- inner_join(dd1,dd2)
Joining, by = "pt_id"
# export(ds_subject, file="I:/SHARE/USERS/plebeau/CGM/T1D study data/AnalysisData/ds_subject.RDS")
# Visit data
#dd3 <- read_delim("I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HVisitInfo.txt", delim = "|")
#export(dd3, "I:/SHARE/USERS/plebeau/CGM/T1D study data/DataTables/HVisitInfo.rds")
ds_visit <- read_delim("../data/HVisitInfo.txt", delim = "|") %>%
janitor::clean_names() %>%
mutate_if(is.character,as.factor) %>%
mutate(pt_id=as.factor(pt_id)) %>%
filter(visit %in% c('Randomization','Week 3 Visit', 'Week 6 Visit', 'Week 13 Visit',
'Week 19 Visit', 'Week 26 Visit')) %>%
droplevels() %>%
mutate(visit = fct_relevel(visit, c("Randomization", "Week 3 Visit",
"Week 6 Visit", "Week 13 Visit", "Week 19 Visit", "Week 26 Visit"))) %>%
mutate(visit_dt_days_from_enroll_lag7 = visit_dt_days_from_enroll - 7) %>%
mutate(visitnum = fct_recode(visit, "0" = "Randomization",
"1" = "Week 3 Visit",
"2" = "Week 6 Visit",
"3" = "Week 13 Visit",
"4" = "Week 19 Visit",
"5" = "Week 26 Visit")) %>%
select(pt_id, visit, visitnum, visit_dt_days_from_enroll, visit_dt_days_from_enroll_lag7)
Parsed with column specification:
cols(
ParentLoginVisitID = col_double(),
RecID = col_double(),
PtID = col_double(),
SiteID = col_double(),
Visit = col_character(),
VisitDtDaysFromEnroll = col_double(),
OutOfWin = col_double(),
OutOfWinReason = col_character(),
VisitMiss = col_double(),
VisitMissReason = col_character()
)
# export(ds_visit, file="I:/SHARE/USERS/plebeau/CGM/T1D study data/AnalysisData/ds_visit.RDS")
table(ds_visit$visit)
Randomization Week 3 Visit Week 6 Visit Week 13 Visit Week 19 Visit Week 26 Visit
226 224 224 221 219 217
# Get CGM data from 7 days prior to the visit
ds_cgm <- left_join(dd0, ds_visit, by = c("pt_id")) %>%
filter( (device_dt_tm_days_from_enroll >= visit_dt_days_from_enroll_lag7 &
device_dt_tm_days_from_enroll <= visit_dt_days_from_enroll) ) %>%
select(pt_id, visit, visitnum, visit_dt_days_from_enroll_lag7, visit_dt_days_from_enroll,
device_dt_tm_days_from_enroll, device_tm, glucose_value)
#export(ds_cgm, file = "I:/SHARE/USERS/plebeau/CGM/T1D study data/AnalysisData/ds_cgm.RDS")
13 Variables 226 Observations
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 226 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 226 | 0 | 14 | 0.994 | 8.221 | 5.112 | 1.0 | 2.0 | 5.0 | 8.0 | 12.0 | 14.5 | 15.0 |
Value 1 2 3 5 6 7 8 9 10 11 12 13
Frequency 15 16 17 19 27 14 8 14 15 18 13 12
Proportion 0.066 0.071 0.075 0.084 0.119 0.062 0.035 0.062 0.066 0.080 0.058 0.053
Value 14 15
Frequency 15 23
Proportion 0.066 0.102
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 2 |
Value F M Frequency 112 114 Proportion 0.496 0.504
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 3 |
Value Hispanic or Latino Not Hispanic or Latino Unknown/not reported Frequency 9 216 1 Proportion 0.040 0.956 0.004
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 226 | 0 | 55 | 0.999 | 20.75 | 14.9 | 5.00 | 6.00 | 10.00 | 18.00 | 28.75 | 39.00 | 47.00 |
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 2 |
Value No Yes Frequency 210 16 Proportion 0.929 0.071
| n | missing | distinct |
|---|---|---|
| 221 | 5 | 7 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 226 | 0 | 177 | 1 | 81.22 | 17.68 | 59.00 | 62.15 | 69.73 | 79.50 | 91.40 | 102.35 | 110.68 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 226 | 0 | 108 | 1 | 172.4 | 12.02 | 155.0 | 159.0 | 164.1 | 172.0 | 180.0 | 186.0 | 189.0 |
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 3 |
Value Current In past, but not current
Frequency 107 79
Proportion 0.473 0.350
Value Never
Frequency 40
Proportion 0.177
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 2 |
Value Completed Dropped Frequency 217 9 Proportion 0.96 0.04
| n | missing | distinct |
|---|---|---|
| 226 | 0 | 2 |
Value CGM Only CGM+BGM Frequency 149 77 Proportion 0.659 0.341
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 226 | 0 | 53 | 0.999 | 44 | 15.84 | 25 | 27 | 31 | 43 | 55 | 63 | 67 |
| n | missing | distinct |
|---|---|---|
| 1331 | 0 | 226 |
| n | missing | distinct |
|---|---|---|
| 1331 | 0 | 6 |
Value Randomization Week 3 Visit Week 6 Visit Week 13 Visit Week 19 Visit
Frequency 226 224 224 221 219
Proportion 0.170 0.168 0.168 0.166 0.165
Value Week 26 Visit
Frequency 217
Proportion 0.163
| n | missing | distinct |
|---|---|---|
| 1331 | 0 | 6 |
Value 0 1 2 3 4 5 Frequency 226 224 224 221 219 217 Proportion 0.170 0.168 0.168 0.166 0.165 0.163
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1328 | 3 | 256 | 1 | 134 | 79.65 | 30.0 | 49.0 | 76.0 | 119.0 | 195.0 | 243.0 | 254.6 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1328 | 3 | 256 | 1 | 127 | 79.65 | 23.0 | 42.0 | 69.0 | 112.0 | 188.0 | 236.0 | 247.6 |
| n | missing | distinct |
|---|---|---|
| 2785354 | 0 | 226 |
| n | missing | distinct |
|---|---|---|
| 2785354 | 0 | 6 |
Value Randomization Week 3 Visit Week 6 Visit Week 13 Visit Week 19 Visit
Frequency 489014 479416 472970 462985 454468
Proportion 0.176 0.172 0.170 0.166 0.163
Value Week 26 Visit
Frequency 426501
Proportion 0.153
| n | missing | distinct |
|---|---|---|
| 2785354 | 0 | 6 |
Value 0 1 2 3 4 5 Frequency 489014 479416 472970 462985 454468 426501 Proportion 0.176 0.172 0.170 0.166 0.163 0.153
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2785354 | 0 | 255 | 1 | 125 | 78.91 | 22 | 42 | 68 | 111 | 185 | 231 | 247 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2785354 | 0 | 255 | 1 | 132 | 78.91 | 29 | 49 | 75 | 118 | 192 | 238 | 254 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2785354 | 0 | 313 | 1 | 128.4 | 78.89 | 26 | 44 | 71 | 114 | 188 | 234 | 251 |
| n | missing | distinct |
|---|---|---|
| 2785354 | 0 | 86400 |
| n | missing | distinct | Info | Mean | Gmd | .05 | .10 | .25 | .50 | .75 | .90 | .95 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2785354 | 0 | 363 | 1 | 159.1 | 70.32 | 74 | 86 | 112 | 149 | 196 | 245 | 278 |
Should we exclude these from analysis?
table(ds_subject$pt_status,ds_subject$trt_group)
CGM Only CGM+BGM
Completed 142 75
Dropped 7 2
Could be used for subgroup analyses
table(ds_subject$cgm_use_status, ds_subject$trt_group)
CGM Only CGM+BGM
Current 69 38
In past, but not current 54 25
Never 26 14
ds_cgmu <- ds_cgm %>%
group_by(pt_id, visitnum) %>%
arrange(pt_id, visitnum) %>%
filter(row_number()==1)
#' Number of subjects
length(unique(ds_cgmu$pt_id))
[1] 226
addmargins(table(ds_cgmu$pt_id, ds_cgmu$visitnum))
0 1 2 3 4 5 Sum
2 1 1 1 1 1 1 6
3 1 1 1 1 1 1 6
5 1 1 1 1 0 1 5
7 1 1 1 1 1 1 6
8 1 1 1 1 1 1 6
9 1 1 1 1 1 1 6
10 1 1 1 1 1 1 6
11 1 1 1 1 1 1 6
14 1 1 1 1 1 1 6
15 1 1 1 1 1 1 6
16 1 1 1 1 1 1 6
17 1 1 1 1 1 1 6
18 1 1 1 1 1 1 6
19 1 1 1 1 1 1 6
20 1 1 1 1 1 1 6
21 1 1 1 1 1 1 6
22 1 1 1 1 1 1 6
23 1 1 1 1 1 1 6
24 1 1 1 1 1 1 6
26 1 1 1 1 1 1 6
27 1 1 1 1 1 1 6
29 1 1 1 1 1 1 6
30 1 1 1 1 1 1 6
31 1 1 1 1 1 1 6
32 1 1 1 1 1 1 6
33 1 1 1 1 1 1 6
35 1 1 1 1 1 1 6
36 1 1 1 1 1 1 6
37 1 1 1 1 1 0 5
38 1 1 1 1 1 1 6
39 1 1 1 0 0 0 3
40 1 1 1 1 1 1 6
41 1 1 1 1 1 1 6
42 1 1 1 1 1 1 6
43 1 1 1 1 1 1 6
45 1 1 1 1 1 1 6
46 1 1 1 1 1 1 6
47 1 1 1 1 1 1 6
48 1 1 1 1 1 1 6
49 1 1 1 1 1 1 6
50 1 1 1 1 1 1 6
52 1 0 0 0 0 0 1
53 1 1 1 1 1 1 6
54 1 1 1 1 1 1 6
55 1 1 1 1 1 1 6
57 1 1 1 1 1 1 6
58 1 1 1 1 1 1 6
60 1 1 1 1 1 1 6
61 1 1 1 1 1 1 6
62 1 1 1 1 1 1 6
64 1 1 1 1 1 1 6
65 1 1 1 1 1 1 6
67 1 1 1 1 1 1 6
68 1 1 1 1 1 1 6
69 1 1 1 1 1 1 6
70 1 1 1 1 1 1 6
71 1 1 1 1 1 1 6
72 1 1 1 1 1 0 5
73 1 1 1 1 1 1 6
74 1 1 1 1 1 1 6
76 1 1 1 1 1 1 6
77 1 1 1 1 1 1 6
78 1 1 1 1 1 1 6
79 1 1 1 1 1 1 6
80 1 1 1 1 1 1 6
81 1 1 1 1 1 1 6
82 1 1 1 1 1 1 6
86 1 1 1 1 1 1 6
87 1 1 1 1 1 1 6
89 1 1 1 1 1 1 6
90 1 1 1 1 1 1 6
91 1 1 1 1 1 0 5
93 1 0 1 1 1 1 5
95 1 1 1 1 1 1 6
96 1 1 1 1 1 1 6
97 1 1 1 1 1 1 6
98 1 1 1 1 1 1 6
101 1 1 1 1 1 1 6
102 1 1 1 1 1 1 6
103 1 1 1 1 1 1 6
105 1 1 1 1 1 1 6
106 1 1 1 1 1 1 6
108 1 1 1 1 1 1 6
109 1 1 1 1 1 1 6
110 1 1 1 1 1 1 6
111 1 1 1 1 1 1 6
112 1 1 1 1 1 1 6
113 1 1 1 1 1 1 6
115 1 1 1 1 1 1 6
116 1 1 1 1 1 1 6
118 1 1 1 1 1 1 6
119 1 1 1 1 1 1 6
121 1 1 1 1 1 1 6
123 1 1 1 1 1 1 6
124 1 1 1 1 1 1 6
127 1 1 1 1 1 1 6
128 1 1 1 1 1 1 6
129 1 1 1 1 1 1 6
130 1 1 1 1 1 1 6
131 1 1 1 1 1 1 6
132 1 1 1 1 1 1 6
134 1 1 1 1 1 1 6
135 1 1 1 1 1 1 6
136 1 1 1 1 1 1 6
137 1 1 1 1 1 1 6
138 1 1 1 1 1 1 6
139 1 1 1 1 1 1 6
140 1 1 1 1 1 1 6
141 1 1 1 1 1 1 6
143 1 1 1 1 1 1 6
145 1 1 1 1 1 1 6
146 1 1 1 1 1 1 6
147 1 1 1 1 1 1 6
148 1 1 1 1 1 1 6
149 1 1 1 1 1 1 6
152 1 1 1 1 1 1 6
155 1 1 1 1 1 1 6
156 1 1 1 1 1 1 6
157 1 1 1 1 1 1 6
158 1 1 1 1 1 1 6
160 1 1 1 1 1 1 6
162 1 1 1 1 1 1 6
163 1 1 1 1 1 1 6
164 1 1 1 1 1 1 6
165 1 1 1 1 1 1 6
166 1 1 1 1 1 1 6
167 1 1 1 1 1 1 6
168 1 1 1 1 1 1 6
169 1 1 1 1 1 1 6
170 1 1 1 1 1 1 6
171 1 1 1 1 1 1 6
172 1 1 1 1 1 1 6
173 1 1 1 1 1 1 6
174 1 1 1 1 1 1 6
175 1 1 1 1 1 1 6
176 1 1 1 1 1 1 6
177 1 1 1 1 1 1 6
179 1 1 1 1 1 1 6
181 1 1 1 1 1 1 6
183 1 1 1 1 1 1 6
184 1 1 1 1 1 1 6
185 1 1 1 1 1 1 6
186 1 1 1 1 1 1 6
187 1 1 1 1 1 1 6
188 1 1 1 1 1 1 6
189 1 1 1 1 1 1 6
190 1 1 1 1 1 1 6
193 1 1 1 1 1 1 6
197 1 1 1 1 1 1 6
198 1 1 1 1 1 1 6
200 1 1 1 1 1 1 6
201 1 1 1 1 1 1 6
203 1 1 1 1 1 1 6
204 1 1 1 1 1 1 6
205 1 1 1 1 1 1 6
206 1 1 1 1 1 1 6
209 1 1 1 1 1 1 6
210 1 1 1 1 1 1 6
211 1 1 1 1 1 1 6
213 1 1 1 1 1 1 6
214 1 1 1 1 1 1 6
215 1 1 1 1 1 1 6
216 1 1 1 1 1 1 6
217 1 1 1 1 1 1 6
218 1 1 1 1 1 1 6
219 1 1 1 1 1 1 6
220 1 1 1 1 1 1 6
221 1 1 1 1 1 1 6
222 1 1 1 1 1 1 6
223 1 0 0 0 0 0 1
224 1 1 1 1 1 1 6
226 1 1 1 1 1 1 6
227 1 1 1 1 1 1 6
228 1 1 1 1 1 1 6
229 1 1 1 1 1 1 6
231 1 1 1 1 1 1 6
232 1 1 1 1 1 1 6
233 1 1 1 1 1 1 6
234 1 1 1 1 1 1 6
235 1 1 1 1 1 1 6
236 1 1 1 1 1 1 6
239 1 1 1 1 1 1 6
240 1 1 1 1 1 1 6
241 1 1 1 1 1 1 6
243 1 1 1 1 1 1 6
244 1 1 1 0 1 1 5
245 1 1 1 1 1 1 6
246 1 1 1 1 1 1 6
247 1 1 1 1 1 1 6
248 1 1 1 1 1 1 6
249 1 1 0 0 0 0 2
250 1 1 1 1 1 1 6
251 1 1 1 1 1 1 6
252 1 1 1 1 1 1 6
253 1 1 1 1 1 1 6
254 1 1 1 1 1 1 6
256 1 1 1 1 1 1 6
257 1 1 1 1 1 1 6
258 1 1 1 1 1 1 6
260 1 1 1 1 1 1 6
263 1 1 1 1 1 1 6
264 1 1 1 1 0 0 4
265 1 1 1 1 1 1 6
266 1 1 1 0 0 0 3
267 1 1 1 1 1 1 6
269 1 1 1 1 1 1 6
271 1 1 1 1 1 1 6
272 1 1 1 1 1 1 6
273 1 1 1 1 1 1 6
274 1 1 1 1 1 1 6
275 1 1 1 1 1 1 6
276 1 1 1 1 1 1 6
277 1 1 1 1 1 1 6
278 1 1 1 1 1 1 6
280 1 1 1 1 1 1 6
281 1 1 1 1 1 1 6
283 1 1 1 1 1 1 6
284 1 1 1 1 1 1 6
285 1 1 1 1 1 1 6
287 1 1 1 1 1 1 6
288 1 1 1 1 1 1 6
289 1 0 0 0 0 0 1
290 1 1 1 1 1 1 6
291 1 1 1 1 1 1 6
292 1 1 1 1 1 1 6
293 1 1 1 1 1 1 6
Sum 226 222 222 219 218 216 1323
Only a few have missing visits - leave as is?
Next plot shows subjects with data at what visits.
ggplot(ds_cgmu, aes(x=visitnum, y=pt_id, fill=visitnum)) +
geom_tile(color = "white", size=0.25) +
scale_y_discrete(expand=c(0,0)) +
#coord_fixed() +
scale_fill_brewer(palette = "Paired") +
theme_bw() +
labs (title = "Visits with CGM data by subject",
y = "Subject ID",
x = "Visit Number")
summary(ds_cgm$glucose_value)
Min. 1st Qu. Median Mean 3rd Qu. Max.
39.0 112.0 149.0 159.1 196.0 401.0
#for (i in unique(dd0_1$pt_id)) {
for (i in unique(ds_cgm$pt_id)[1:10]) {
p <- ggplot(data = subset(ds_cgm, pt_id == i), aes(x = device_dt_tm_days_from_enroll,
y = glucose_value, col=visitnum)) +
geom_point(size=0.5) +
geom_hline(yintercept=70, color="black", linetype="dashed") +
geom_hline(yintercept=180, color="black", linetype="dashed") +
scale_color_brewer(palette = "Paired") +
theme_bw() +
#scale_x_date(labels = date_format("%m-%Y")) +
ggtitle(as.character(i)) +
guides(col = guide_legend(override.aes = list(size=10)))
print(p)
}
#' Look at individual daily trajectories by visit
for (i in unique(ds_cgm$pt_id)[1:10]) {
pp <- ggplot(data = subset(ds_cgm, pt_id == i),
aes(x = device_tm, y = glucose_value, group=as.factor(device_dt_tm_days_from_enroll),
col=as.factor(visitnum))) +
facet_wrap(pt_id~visitnum) +
geom_line(size=0.1, show.legend=FALSE) +
theme_bw()+
geom_hline(yintercept=70, color="black", linetype="dashed") +
geom_hline(yintercept=180, color="black", linetype="dashed") +
scale_color_brewer(palette = "Paired")
print(pp)
}
#Relabel
var.labels <- c(gender = "Gender",
ethnicity = "Ethnicity",
diag_age = "Age at Diagnosis",
oth_gluc_lower_med = "Other Glucose Lowering Medication",
edu_level = "Highest Education Level",
weight = "Weight",
height = "Height",
cgm_use_status = "CGM Use",
pt_status = "Completed Study",
trt_group = "Treatment Group",
age_as_of_enroll_dt = "Age at Enrollment"
)
ds_subject <- Hmisc::upData(ds_subject, labels = var.labels)
Input object size: 37968 bytes; 13 variables 226 observations
New object size: 39544 bytes; 13 variables 226 observations
compareGroups(trt_group ~ pt_status + gender + ethnicity + diag_age + age_as_of_enroll_dt +
edu_level + weight + height + cgm_use_status,
data = ds_subject,
include.miss = TRUE) %>%
createTable(show.p.overall = TRUE,
#hide = c("No"),
show.n = TRUE) %>%
export2md(strip = TRUE, first.strip = TRUE)
| CGM Only | CGM+BGM | p.overall | N | |
|---|---|---|---|---|
| N=149 | N=77 | |||
| Completed Study: | 0.722 | 226 | ||
| Completed | 142 (95.3%) | 75 (97.4%) | ||
| Dropped | 7 (4.70%) | 2 (2.60%) | ||
| Gender: | 0.511 | 226 | ||
| F | 71 (47.7%) | 41 (53.2%) | ||
| M | 78 (52.3%) | 36 (46.8%) | ||
| Ethnicity: | 0.352 | 226 | ||
| Hispanic or Latino | 4 (2.68%) | 5 (6.49%) | ||
| Not Hispanic or Latino | 144 (96.6%) | 72 (93.5%) | ||
| Unknown/not reported | 1 (0.67%) | 0 (0.00%) | ||
| Age at Diagnosis | 20.8 (13.8) | 20.6 (13.0) | 0.919 | 226 |
| Age at Enrollment | 43.5 (14.1) | 45.0 (13.2) | 0.434 | 226 |
| Highest Education Level: | 0.300 | 226 | ||
| Associate Degree | 6 (4.03%) | 3 (3.90%) | ||
| Bachelor’s Degree | 75 (50.3%) | 35 (45.5%) | ||
| Doctorate Degree | 3 (2.01%) | 3 (3.90%) | ||
| High school graduate/diploma/GED | 6 (4.03%) | 2 (2.60%) | ||
| Master’s Degree | 29 (19.5%) | 18 (23.4%) | ||
| Professional Degree | 6 (4.03%) | 5 (6.49%) | ||
| Some college but no degree | 23 (15.4%) | 7 (9.09%) | ||
| ‘Missing’ | 1 (0.67%) | 4 (5.19%) | ||
| Weight | 82.7 (15.6) | 78.4 (15.6) | 0.053 | 226 |
| Height | 173 (10.6) | 172 (10.4) | 0.792 | 226 |
| CGM Use: | 0.852 | 226 | ||
| Current | 69 (46.3%) | 38 (49.4%) | ||
| In past, but not current | 54 (36.2%) | 25 (32.5%) | ||
| Never | 26 (17.4%) | 14 (18.2%) |